﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using snat.model;

namespace algorithms.algorithms.Agent
{
    public class AgentNodeFactory : INodeFactory {

        double probability;
        Random rand = new Random();
        public AgentNodeFactory(double probability) {
            this.probability = probability;
        }

        public BaseNode Instantiate(snat.proxy.items.DBEntity e) {
            if (rand.NextDouble() < probability) {
                return new SensibleNode(e.EntityID, e.EntityName);
            } else {
                return new MaliciousNode(e.EntityID, e.EntityName);
            }
        }
    
    }
}
